/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.gui;

/**
 *
 * @author Teao
 */
public class AdmPrincipal extends javax.swing.JFrame {
    
    static final int ALTURA  = 460;
    static final int LARGURA = 760;

    /**
     * Creates new form AdmPrincipal
     */
    public AdmPrincipal() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BSair = new javax.swing.JButton();
        BLogoff = new javax.swing.JButton();
        PAdminstrador = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        MAdicionar = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        MAdicionarAluno = new javax.swing.JMenuItem();
        MModificarAluno = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        MAdicionarProfessor = new javax.swing.JMenuItem();
        MProfConsultar = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        MAdicionarTurma = new javax.swing.JMenuItem();
        MTurmaConsultar = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        MAdicionarDisc = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        BSair.setText("Sair");
        BSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BSairActionPerformed(evt);
            }
        });
        getContentPane().add(BSair);
        BSair.setBounds(560, 500, 210, 60);

        BLogoff.setText("Logoff...");
        BLogoff.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BLogoffActionPerformed(evt);
            }
        });
        getContentPane().add(BLogoff);
        BLogoff.setBounds(30, 500, 210, 60);

        PAdminstrador.setToolTipText("Programa UFLN - Administrador");
        PAdminstrador.setAutoscrolls(true);
        PAdminstrador.setLayout(null);
        getContentPane().add(PAdminstrador);
        PAdminstrador.setBounds(20, 20, 760, 460);
        PAdminstrador.getAccessibleContext().setAccessibleName("Programa UFLN - Administrador");

        jMenu1.setText("Administrador");

        MAdicionar.setText("Adicionar");
        MAdicionar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MAdicionarActionPerformed(evt);
            }
        });
        jMenu1.add(MAdicionar);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Aluno");

        MAdicionarAluno.setText("Adicionar");
        MAdicionarAluno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MAdicionarAlunoActionPerformed(evt);
            }
        });
        jMenu2.add(MAdicionarAluno);

        MModificarAluno.setText("Consultar");
        MModificarAluno.setToolTipText("");
        MModificarAluno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MModificarAlunoActionPerformed(evt);
            }
        });
        jMenu2.add(MModificarAluno);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Professor");

        MAdicionarProfessor.setText("Adicionar");
        MAdicionarProfessor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MAdicionarProfessorActionPerformed(evt);
            }
        });
        jMenu3.add(MAdicionarProfessor);

        MProfConsultar.setText("Consultar");
        MProfConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MProfConsultarActionPerformed(evt);
            }
        });
        jMenu3.add(MProfConsultar);

        jMenuBar1.add(jMenu3);

        jMenu4.setText("Turma");

        MAdicionarTurma.setText("Adicionar");
        MAdicionarTurma.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MAdicionarTurmaActionPerformed(evt);
            }
        });
        jMenu4.add(MAdicionarTurma);

        MTurmaConsultar.setText("Consultar");
        MTurmaConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MTurmaConsultarActionPerformed(evt);
            }
        });
        jMenu4.add(MTurmaConsultar);

        jMenuBar1.add(jMenu4);

        jMenu6.setText("Disciplina");

        MAdicionarDisc.setText("Adicionar");
        MAdicionarDisc.setToolTipText("");
        MAdicionarDisc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MAdicionarDiscActionPerformed(evt);
            }
        });
        jMenu6.add(MAdicionarDisc);

        jMenuItem1.setText("Consultar");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem1);

        jMenuBar1.add(jMenu6);

        setJMenuBar(jMenuBar1);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-831)/2, (screenSize.height-643)/2, 831, 643);
    }// </editor-fold>//GEN-END:initComponents

	//-------------------------- Menu do administrador ---------------------------//
    private void MAdicionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MAdicionarActionPerformed
        // Vai abrir no Painel Principal do Administrador
        // a GUI referente a adicionar o integrante.
        GuiAdmCadastrar panel = new GuiAdmCadastrar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
        
    }//GEN-LAST:event_MAdicionarActionPerformed
	
	//----------------------            Fim do Menu      -----------------//
	
    //---------------------- 		Menu do Aluno	----------------------//
    private void MAdicionarAlunoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MAdicionarAlunoActionPerformed
        
        GuiAlunoCadastrar panel = new GuiAlunoCadastrar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
    }//GEN-LAST:event_MAdicionarAlunoActionPerformed

    
    private void MModificarAlunoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MModificarAlunoActionPerformed
        
        GuiAlunoConsultar panel = new GuiAlunoConsultar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
    }//GEN-LAST:event_MModificarAlunoActionPerformed

	//-------		Fim do Menu    ----------------------//

	//------- 		Menu do Professor -------------------//	
    private void MAdicionarProfessorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MAdicionarProfessorActionPerformed
        
        GuiProfCadastrar panel = new GuiProfCadastrar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
    }//GEN-LAST:event_MAdicionarProfessorActionPerformed

	//---------     Fim do Menu    --------------------------//
	
	//-----------  Menu Turma -------------------------------//
    private void MAdicionarTurmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MAdicionarTurmaActionPerformed
        
        GuiTurmaCadastrar panel = new GuiTurmaCadastrar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
    }//GEN-LAST:event_MAdicionarTurmaActionPerformed

    private void MTurmaConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MTurmaConsultarActionPerformed
        // Implementa um jeito de interagir o painel GuiTurmaConsultar
        GuiTurmaConsultar panel = new GuiTurmaConsultar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
        
    }//GEN-LAST:event_MTurmaConsultarActionPerformed
    
	//--------------- Fim do Menu --------------------//
	
	//--------------- Menu Disciplina ----------------//
    private void MAdicionarDiscActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MAdicionarDiscActionPerformed
        
        GuiDiscCadastrar panel = new GuiDiscCadastrar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
    }//GEN-LAST:event_MAdicionarDiscActionPerformed

	private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        
        GuiDiscConsultar panel = new GuiDiscConsultar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

	//------------------     Fim do Menu ----------------------------------//
	
	//------------------     Botões comuns      ---------------------------//
    private void BLogoffActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BLogoffActionPerformed
        
        this.setVisible(false);
        TelaLogin janela = new TelaLogin();
        janela.setVisible(true);
    }//GEN-LAST:event_BLogoffActionPerformed

	private void BSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BSairActionPerformed
        System.exit(0);
    }//GEN-LAST:event_BSairActionPerformed

    private void MProfConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MProfConsultarActionPerformed
        // TODO add your handling code here
        
        GuiProfConsultar panel = new GuiProfConsultar();
        PAdminstrador.removeAll();
        PAdminstrador.add(panel);
        PAdminstrador.repaint();
        panel.setLocation(0,0);
        panel.setSize(LARGURA, ALTURA);
    }//GEN-LAST:event_MProfConsultarActionPerformed

    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(AdmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(AdmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(AdmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(AdmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new AdmPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BLogoff;
    private javax.swing.JButton BSair;
    private javax.swing.JMenuItem MAdicionar;
    private javax.swing.JMenuItem MAdicionarAluno;
    private javax.swing.JMenuItem MAdicionarDisc;
    private javax.swing.JMenuItem MAdicionarProfessor;
    private javax.swing.JMenuItem MAdicionarTurma;
    private javax.swing.JMenuItem MModificarAluno;
    private javax.swing.JMenuItem MProfConsultar;
    private javax.swing.JMenuItem MTurmaConsultar;
    private javax.swing.JPanel PAdminstrador;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    // End of variables declaration//GEN-END:variables
}
